/**
 * 2017年3月20日
 */
package cn.edu.bjtu.alex.rewrite.tools;


import java.util.Map.Entry;
import java.util.regex.Pattern;

import cn.edu.bjtu.alex.rewrite.interfaces.Term;

/**
 * @author Alex
 *
 */
public class RegExNumberFilter extends AbstractFilter {
	public static Pattern NUM_PATTERN = Pattern.compile("[+-]?\\d+(?:\\.\\d+)?(?:e[+-]?\\d+)?");

	@Override
	protected boolean shouldRemove(Entry<String, Term> termEntry) {
		return NUM_PATTERN.matcher(termEntry.getValue().getWord()).find();
	}


}
